<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

</head>

<body>
    <script>
        /* console.dir(Promise);
        let myPromise = url => $.ajax({ url: url })

        let p1 = myPromise('../data/1.json')
        let p2 = myPromise('../data/2.json')
        let p3 = myPromise('../data/3.json')
        console.log(p1)

        Promise.all([p1, p2, p3]).then(arr => {
            console.log(arr)
        })

        Promise.all([p1, p2, p3]).then(([res1, res2, res3]) => {
            console.log(res1)
            console.log(res2)
            console.log(res3)
        }) */

        let myPromise = url => $.ajax({ url: url })

        let p1 = myPromise('../data/1.json')
        let p2 = myPromise('../data/2.json')
        let p3 = myPromise('../data/3.json')

        Promise.all([p1, p2, p3]).then(([r1, r2, r3]) => {
            console.log(r1)
            console.log(r2)
            console.log(r3)
        })

        /*  let myPromise = url => $.ajax({ url: url })
         let p1 = myPromise('../data/1.json')
         let p2 = myPromise('../data/2.json')
         let p3 = myPromise('../data/3.json')
 
         Promise.all([p1, p2, p3]).then((res) => console.log(res)) */

    </script>
</body>

</html>